package com.changan.config;

import io.milvus.client.MilvusServiceClient;
import io.milvus.param.ConnectParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Slf4j
@Configuration
public class MilvusConfig {
    @Bean
    public MilvusServiceClient milvusClient() {
        log.info("初始化 Milvus 客户端，连接地址: {}:{}", "localhost", 19530);
        MilvusServiceClient client = new MilvusServiceClient(
            ConnectParam.newBuilder()
                .withHost("localhost")
                .withPort(19530)
                .build()
        );
        log.info("Milvus 客户端初始化完成");
        return client;
    }
}